import React from "react";
import { Button, Form, Input, Select, message as antdMessage } from "antd";
import { postListAdd } from "../../service";
const typeList = ["待付款", "已付款", "已发货", "已收货", "已完成"];
const Index: React.FC = () => {
  const onFinish = async (values: any) => {
    const resp = await postListAdd(values);
    const { code, message } = resp.data;
    antdMessage.success(message);
  };
  return (
    <div>
      <Form onFinish={onFinish}>
        <Form.Item label="标题" name={"title"}>
          <Input></Input>
        </Form.Item>
        <Form.Item label="总价" name={"price"}>
          <Input></Input>
        </Form.Item>
        <Form.Item label="类型" name={"type"} initialValue={"待付款"}>
          <Input></Input>
        </Form.Item>
        <Form.Item label="图片" name={"image"}>
          <Input></Input>
        </Form.Item>
        <Form.Item>
          <Button type="primary" htmlType="submit">
            提交
          </Button>
        </Form.Item>
      </Form>
    </div>
  );
};
export default Index;
